//src/App.vue

<template>
<div id="event-handling">
  <p>{{ message }}</p>
  <button @click="reverseMessage">反转 Message</button>
</div>
</template>

<script lang="ts">

export default {
  name: 'App',
  data() {
    return {
      message: 'Hello Vue.js!'
    }
  },
  methods: {
    reverseMessage() {
      this.message = this.message
        .split('')
        .reverse()
        .join('')
    }
  }
}
</script>